]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Don't hide destroyed child widget on unmap
authorJonas Ådahl <jadahl@gmail.com>
Thu, 2 Feb 2023 14:54:05 +0000 (15:54 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 6 Feb 2023 18:10:01 +0000 (18:10 +0000)
When we unmap, the child widgets have already been destroyed, so we
shouldn't try to. To detect this, delete the references we keep to them
on destroy, and null-check the hide call.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2623>

js/ui/overviewControls.js

index 66f291b1071bcdca39e8ec5f6856e6147e8d9cc2..3528a73b13a33ebc563751156ecc509b7456f0c7 100644 (file)
@@ -506,6 +506,8 @@ class ControlsManager extends St.Widget {
             () => this._shiftState(Meta.MotionDirection.DOWN));
 
         this._update();
+
+        this.connect('destroy', this._onDestroy.bind(this));
     }
 
     _getFitModeForState(state) {
@@ -715,7 +717,16 @@ class ControlsManager extends St.Widget {
 
     vfunc_unmap() {
         super.vfunc_unmap();
-        this._workspacesDisplay.hide();
+        this._workspacesDisplay?.hide();
+    }
+
+    _onDestroy() {
+        delete this._searchEntryBin;
+        delete this._appDisplay;
+        delete this.dash;
+        delete this._searchController;
+        delete this._thumbnailsBox;
+        delete this._workspacesDisplay;
     }
 
     prepareToEnterOverview() {